// 导入高阶组件observer
import { observer } from 'mobx-react';
// 导入observable创建可观察对象的方法
// import { observable } from 'mobx';
import counter from '../mobx/counter';
import article from '../mobx/article';
function User() {
    return <div style={{ background: '#EEE', padding: 10, margin: '10px 0' }}>
        <h1>mobx状态管理-函数组件</h1>
        <hr />
        <ol>
            {
                article.articleList.map(item => <li key={item.id}>{item.title}</li>)
            }
        </ol>
        <hr />
        <h1>{counter.count}</h1>
        <button onClick={() => counter.decrease(2)}>-N</button>
        &nbsp;
        &nbsp;
        <button onClick={() => counter.increase(10)}>+N</button>

    </div>
}

export default observer(User);